import math
from difflib import Match


class Person :
    def __init__(self, name, age) :
        self.name = name
        self.age = age
    def show (self) :
        print(f'{self.name}<UNK>{self.age}<UNK>{self.job}')

class Speek :
    def __init__(self, name,job) :
        self.name = name
        self.job = job

    def speak (self) :
        print(f'{self.name}它在讲{self.job}课程')

class Student(Person,Speek) :
    def __init__(self, name, age, job) :
        # super().__init__(name, age)
        Person.__init__(self,name,age)
        Speek.__init__(self,name,job)
        # self.job = job

class Doctor(Person, Speek) :
    def __init__(self, name, age, job) :
        super().__init__(name, age)
        self.job = job

    def speak (self) : # 重写父类方法
        super().speak() # 可以不调用，直接改写
        print('重写父类speak方法')

stu = Student(name='张三', age=18, job='前端')
doc = Doctor(name='李四', age=18, job='医生')

# 调用父级方法
stu.show()
doc.show()

stu.speak()
doc.speak()



# 计算圆的周长和面积

class Round() :
    def __init__(self,radius) :
        self.redius = radius

    def sumArea(self):
        return self.redius * self.redius *math.pi
    def sumPerimeter(self):
        return math.pi * self.redius*2
run = input('请输入半径：')
if run.isdigit() :
    r = Round(int(run))
    print(r.sumArea())
    print(r.sumPerimeter())
else :
    print('输入的半径不正确')